package cn.tedu.micro.demo.es.po;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.Setting;

import java.util.Date;

/**
 * 假设业务中有学生数据 要读写学生数据
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName="student")
@Setting(shards=5,replicas=1)
public class StudentEsPO {
    //主键
    @Id
    @Field(type= FieldType.Integer)
    private Integer id;
    @Field(type= FieldType.Keyword)
    private String name;
    @Field(type= FieldType.Integer)
    private Integer age;
    @Field(type= FieldType.Text)
    private String profile;//学生介绍
    @Field(type= FieldType.Date)
    private Date birthday;
}
